#pragma once
#ifndef GAMESERVER_H
#define GAMESERVER_H

#include <qqueue.h>
#include <winsock2.h>
#include <functional> 
#include <boost/container/flat_set.hpp>
#include <boost/unordered_map.hpp>
#include "Connection.h"

class GameServer {
public:
	GameServer();
	~GameServer();
	void start();
	void setAcceptHandle(std::function<void(Connection*, char*)> func);
	void sendClient(SOCKET clientSocket, char* buffer);
	void sendAll(char* buffer);
private:
	std::function<void(Connection* client, char*)> doAcceptFunc;
	boost::unordered_map<int, Connection*>* clients = new boost::unordered_map<int, Connection*>();
};

#endif GAMESERVER_H
